#pragma once

#include "Player.h"

namespace My {

/** 
 *  A Player subclass that implements MFC commands
 */
class DLL_API PlayerImpl : public Player
{
public:
	afx_msg void OnTimeFirstFrame();
	afx_msg void OnUpdateTimeFirstFrame(CCmdUI *pCmdUI);
	afx_msg void OnTimeLastFrame();
	afx_msg void OnUpdateTimeLastFrame(CCmdUI *pCmdUI);
	afx_msg void OnTimeWorkAreaStart();
	afx_msg void OnUpdateTimeWorkAreaStart(CCmdUI *pCmdUI);
	afx_msg void OnTimeWorkAreaEnd();
	afx_msg void OnUpdateTimeWorkAreaEnd(CCmdUI *pCmdUI);
	afx_msg void OnTimePreviousFrame();
	afx_msg void OnUpdateTimePreviousFrame(CCmdUI *pCmdUI);
	afx_msg void OnTimeNextFrame();
	afx_msg void OnUpdateTimeNextFrame(CCmdUI *pCmdUI);
	afx_msg void OnTimePlayBackward();
	afx_msg void OnUpdateTimePlayBackward(CCmdUI *pCmdUI);
	afx_msg void OnTimePause();
	afx_msg void OnUpdateTimePause(CCmdUI *pCmdUI);
	afx_msg void OnTimePlayForward();
	afx_msg void OnUpdateTimePlayForward(CCmdUI *pCmdUI);
	afx_msg void OnTimeLoop();
	afx_msg void OnUpdateTimeLoop(CCmdUI *pCmdUI);
	afx_msg void OnTimeGotoFrame();
	afx_msg void OnUpdateTimeGotoFrame(CCmdUI *pCmdUI);
	afx_msg void OnTimePlayPauseForward();
	afx_msg void OnUpdateTimePlayPauseForward(CCmdUI *pCmdUI);
	afx_msg void OnTimePlayPauseBackward();
	afx_msg void OnUpdateTimePlayPauseBackward(CCmdUI *pCmdUI);
	afx_msg void OnTimeFollow();
	afx_msg void OnUpdateTimeFollow(CCmdUI* pCmdUI);
	afx_msg void OnTimeAutoFollow();
	afx_msg void OnUpdateTimeAutoFollow(CCmdUI* pCmdUI);
};

#define DECLARE_PLAYER_COMMANDS() \
	afx_msg void OnTimeFirstFrame() { PlayerImpl::OnTimeFirstFrame(); } \
	afx_msg void OnUpdateTimeFirstFrame(CCmdUI *pCmdUI) { PlayerImpl::OnUpdateTimeFirstFrame(pCmdUI); } \
	afx_msg void OnTimeLastFrame() { PlayerImpl::OnTimeLastFrame(); } \
	afx_msg void OnUpdateTimeLastFrame(CCmdUI *pCmdUI) { PlayerImpl::OnUpdateTimeLastFrame(pCmdUI); } \
	afx_msg void OnTimeWorkAreaStart() { PlayerImpl::OnTimeWorkAreaStart(); } \
	afx_msg void OnUpdateTimeWorkAreaStart(CCmdUI *pCmdUI) { PlayerImpl::OnUpdateTimeWorkAreaStart(pCmdUI); } \
	afx_msg void OnTimeWorkAreaEnd() { PlayerImpl::OnTimeWorkAreaEnd(); } \
	afx_msg void OnUpdateTimeWorkAreaEnd(CCmdUI *pCmdUI) { PlayerImpl::OnUpdateTimeWorkAreaEnd(pCmdUI); } \
	afx_msg void OnTimePreviousFrame() { PlayerImpl::OnTimePreviousFrame(); } \
	afx_msg void OnUpdateTimePreviousFrame(CCmdUI *pCmdUI) { PlayerImpl::OnUpdateTimePreviousFrame(pCmdUI); } \
	afx_msg void OnTimeNextFrame() { PlayerImpl::OnTimeNextFrame(); } \
	afx_msg void OnUpdateTimeNextFrame(CCmdUI *pCmdUI) { PlayerImpl::OnUpdateTimeNextFrame(pCmdUI); } \
	afx_msg void OnTimePlayBackward() { PlayerImpl::OnTimePlayBackward(); } \
	afx_msg void OnUpdateTimePlayBackward(CCmdUI *pCmdUI) { PlayerImpl::OnUpdateTimePlayBackward(pCmdUI); } \
	afx_msg void OnTimePause() { PlayerImpl::OnTimePause(); } \
	afx_msg void OnUpdateTimePause(CCmdUI *pCmdUI) { PlayerImpl::OnUpdateTimePause(pCmdUI); } \
	afx_msg void OnTimePlayForward() { PlayerImpl::OnTimePlayForward(); } \
	afx_msg void OnUpdateTimePlayForward(CCmdUI *pCmdUI) { PlayerImpl::OnUpdateTimePlayForward(pCmdUI); } \
	afx_msg void OnTimeLoop() { PlayerImpl::OnTimeLoop(); } \
	afx_msg void OnUpdateTimeLoop(CCmdUI *pCmdUI) { PlayerImpl::OnUpdateTimeLoop(pCmdUI); } \
	afx_msg void OnTimeGotoFrame() { PlayerImpl::OnTimeGotoFrame(); } \
	afx_msg void OnUpdateTimeGotoFrame(CCmdUI *pCmdUI) { PlayerImpl::OnUpdateTimeGotoFrame(pCmdUI); } \
	afx_msg void OnTimePlayPauseForward() { PlayerImpl::OnTimePlayPauseForward(); } \
	afx_msg void OnUpdateTimePlayPauseForward(CCmdUI *pCmdUI) { PlayerImpl::OnUpdateTimePlayPauseForward(pCmdUI); } \
	afx_msg void OnTimePlayPauseBackward() { PlayerImpl::OnTimePlayPauseBackward(); } \
	afx_msg void OnUpdateTimePlayPauseBackward(CCmdUI *pCmdUI) { PlayerImpl::OnUpdateTimePlayPauseBackward(pCmdUI); } \
	afx_msg void OnTimeFollow() { PlayerImpl::OnTimeFollow(); } \
	afx_msg void OnUpdateTimeFollow(CCmdUI* pCmdUI) { PlayerImpl::OnUpdateTimeFollow(pCmdUI); } \
	afx_msg void OnTimeAutoFollow() { PlayerImpl::OnTimeAutoFollow(); } \
	afx_msg void OnUpdateTimeAutoFollow(CCmdUI* pCmdUI) { PlayerImpl::OnUpdateTimeAutoFollow(pCmdUI); }

//#include <MyControls/Resource.h>
#define ON_PLAYER_COMMANDS() \
	ON_COMMAND(ID_TIME_FIRST_FRAME, OnTimeFirstFrame) \
	ON_UPDATE_COMMAND_UI(ID_TIME_FIRST_FRAME, OnUpdateTimeFirstFrame) \
	ON_COMMAND(ID_TIME_LAST_FRAME, OnTimeLastFrame) \
	ON_UPDATE_COMMAND_UI(ID_TIME_LAST_FRAME, OnUpdateTimeLastFrame) \
	ON_COMMAND(ID_TIME_PREVIOUS_FRAME, OnTimePreviousFrame) \
	ON_UPDATE_COMMAND_UI(ID_TIME_PREVIOUS_FRAME, OnUpdateTimePreviousFrame) \
	ON_COMMAND(ID_TIME_NEXT_FRAME, OnTimeNextFrame) \
	ON_UPDATE_COMMAND_UI(ID_TIME_NEXT_FRAME, OnUpdateTimeNextFrame) \
	ON_COMMAND(ID_TIME_WORK_AREA_START, OnTimeWorkAreaStart) \
	ON_UPDATE_COMMAND_UI(ID_TIME_WORK_AREA_START, OnUpdateTimeWorkAreaStart) \
	ON_COMMAND(ID_TIME_WORK_AREA_END, OnTimeWorkAreaEnd) \
	ON_UPDATE_COMMAND_UI(ID_TIME_WORK_AREA_END, OnUpdateTimeWorkAreaEnd) \
	ON_COMMAND(ID_TIME_PLAY_BACKWARD, OnTimePlayBackward) \
	ON_UPDATE_COMMAND_UI(ID_TIME_PLAY_BACKWARD, OnUpdateTimePlayBackward) \
	ON_COMMAND(ID_TIME_PLAY_FORWARD, OnTimePlayForward) \
	ON_UPDATE_COMMAND_UI(ID_TIME_PLAY_FORWARD, OnUpdateTimePlayForward) \
	ON_COMMAND(ID_TIME_PAUSE, OnTimePause) \
	ON_UPDATE_COMMAND_UI(ID_TIME_PAUSE, OnUpdateTimePause) \
	ON_COMMAND(ID_TIME_LOOP, OnTimeLoop) \
	ON_UPDATE_COMMAND_UI(ID_TIME_LOOP, OnUpdateTimeLoop) \
	ON_COMMAND(ID_TIME_GOTO_FRAME, OnTimeGotoFrame) \
	ON_UPDATE_COMMAND_UI(ID_TIME_GOTO_FRAME, OnUpdateTimeGotoFrame) \
	ON_COMMAND(ID_TIME_PLAYPAUSEBACKWARD, OnTimePlayPauseBackward) \
	ON_UPDATE_COMMAND_UI(ID_TIME_PLAYPAUSEBACKWARD, OnUpdateTimePlayPauseBackward) \
	ON_COMMAND(ID_TIME_PLAYPAUSEFORWARD, OnTimePlayPauseForward) \
	ON_UPDATE_COMMAND_UI(ID_TIME_PLAYPAUSEFORWARD, OnUpdateTimePlayPauseForward) \
	ON_COMMAND(ID_TIME_FOLLOW, OnTimeFollow) \
	ON_UPDATE_COMMAND_UI(ID_TIME_FOLLOW, OnUpdateTimeFollow) \
	ON_COMMAND(ID_TIME_AUTOFOLLOW, OnTimeAutoFollow) \
	ON_UPDATE_COMMAND_UI(ID_TIME_AUTOFOLLOW, OnUpdateTimeAutoFollow)

} //namespace My
